package com.hlhj.carview.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hlhj.carview.R
import com.hlhj.carview.bean.EquipmentListBean

/**
 * Created by Never Fear   on 2018\12\21 0021.
Never More....
 */
class EquipmentAdp(private val datas:ArrayList<EquipmentListBean.InfoBean.DataBean>)
    :BaseQuickAdapter<EquipmentListBean.InfoBean.DataBean,BaseViewHolder>(R.layout.equipment_item,datas) {
    override fun convert(helper: BaseViewHolder?, item: EquipmentListBean.InfoBean.DataBean?) {
        helper?.setText(R.id.itemNum,"设备编号：${item?.device_sn}")
        helper?.setText(R.id.itemType,"型号：${item?.version}")
        helper?.setText(R.id.itemColor,"颜色：${item?.color}")
        helper?.setText(R.id.itemSys,"系统：${item?.system}")
        helper?.setText(R.id.itemPlate,"系统：${item?.car_number}")
        when(item?.status){
            1->{
                helper?.setText(R.id.itemStatus,"正常")
            }
            0->{
                helper?.setText(R.id.itemStatus,"维修中")
            }
        }

    }
}